The c option suppresses an archiver message during the creation process. The q option creates the library and puts mcount.o, mon1.o, and string.o into it.ar cq libtest.a mcount.o mon1.o string.o
To replace an object file in an existing library, enter:
The r option replaces mon1.o in the library libtest.a. If mon1.o does not already exist in the library libtest.a, it is added.ar r libtest.a mon1.o
Note: If you specify the same file twice in an argument list of files to be added to an archive, that file appears twice in the archive. This chapter explains how to build and use dynamic shared objects.